<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Team Bonus Summary</title>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<script language="javascript"> 
function transfer(date_begin,date_end){
	window.location.href = 'http://<?php echo WEB_IP?>/repairparts/repair-wizard-confirm/date_begin/'+ date_begin + '/date_end/' + date_end + '/next/yes';
}

function tickAll(source){
	if(source.checked){
		$('.checkbox').prop('checked',true);
	}else{
		$('.checkbox').prop('checked',false);
	}
}

</script>

</head>
<body style="font-family:Arial, Helvetica, sans-serif; line-height:20px;">
<form method = "post" action = "">
<h2>Calculate Repair Bonus for cycle ( <?php echo $this->cycle;?> )</h2>
<h3><?php echo $this->dateBegin;?> ~ <?php echo $this->dateEnd;?></h3>
<?php $stDetail = new Model_DbTable_Roster_Stafflogindetail();
	?>
Tick All<input type = "checkbox" id = "tick_all" onclick = "tickAll(this)"></input>
<table border="1" cellspacing="1" cellpadding="5">
	<tr>
		<td>Name</td>
		<td>Bonus</td>
		<td>Deduction</td>
		<td>Final Bonus</td>
		<td>Tick For Pay</td>
	</tr>
	<?php foreach ($this->bonusList as $k => $v){
			if($v > 0){
				$stfD = $stDetail->getDetail($k);
				$fName = Model_EncryptHelper::getSslPassword($stfD['n']);?>
				
			<tr>
				<td><?php echo $fName."(".$stfD['ni'].")";if($stfD['a'] == 9){echo "<img src=\"/im/gone.jpg\" />";} ?></td>
				<td><?php echo $v['bonus']?></td>
				<td><?php echo $v['deduction']?><input type = "hidden" name = "deduct_log[<?php echo $k?>]" value = "<?php echo $v['deduct_log'];?>"></input></td>
				<td><?php echo $v['final_bonus']?></td>
				<td><input type = "checkbox" name = "payList[<?php echo $k?>]" class = "checkbox" value = "<?php echo $v['final_bonus']?>"></input></td>
			</tr>
	<?php }}?>
</table>
<br/>
<input type = "submit" name ="submit" id = "submit" value = "Confirm&Next" style = "margin-left:380px;" onclick="if(confirm('Continue calculate repair bonus?')){} else {return false;};"></input>
</form>
</body>
</html>